package com.bwhx.eruler.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bwhx.eruler.bean.Buyer;
import com.bwhx.eruler.bean.BuyerSdk;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.dao.BuyerDao;
import com.bwhx.eruler.dao.BuyerSdkDao;
import com.bwhx.eruler.service.BuyerSdkService;

/**
 * @Description:
 */
@Service
public class BuyerSdkServiceImpl implements BuyerSdkService {
	@Autowired 
	BuyerSdkDao buyerSdkDao;
	
	@Autowired 
	BuyerDao buyerDao;
	
	

	
	@Override
	public List<BuyerSdk> findByBuyerId(BuyerSdk buyerSdk) {
		return buyerSdkDao.findByBuyerId(buyerSdk);
	}

	@Override
	public void insert(BuyerSdk buyerSdk) {
		Buyer buyer = buyerDao.get(buyerSdk.getBuyerId());
		buyerSdk.setBuyerName(buyer.getbName());
		//buyerSdk.setSdkId(buyerSdk.getBuyerId());
		buyerSdkDao.insert(buyerSdk);
		
		
	}

	@Override
	public List<BuyerSdk> list(Page p) {
		return buyerSdkDao.list(p);
	}

	@Override
	public Integer count(BuyerSdk bs) {
		return buyerSdkDao.count(bs);
	}

	@Override
	public List<BuyerSdk> select(BuyerSdk buyerSdk) {
		return buyerSdkDao.select(buyerSdk);
	}

	@Override
	public String getCouter(BuyerSdk buyerSdk) {
		return buyerSdkDao.getCouter(buyerSdk);
	}

	@Override
	public List<BuyerSdk> findBySdkId(BuyerSdk buyerSdk) {
		return buyerSdkDao.findBySdkId(buyerSdk);
	}

	@Override
	public List<BuyerSdk> findByBuerIdAndEndTimeAndType(BuyerSdk buyerSdk) {
		return buyerSdkDao.findByBuerIdAndEndTimeAndType(buyerSdk);

	}

	@Override
	public void updateDevInfosAndDevCount(String sdkId, String devinfo) {
		buyerSdkDao.updateDevInfosAndDevCount(sdkId,devinfo);
		
	}

	@Override
	public void update(BuyerSdk buyerSdk) {
		buyerSdkDao.update(buyerSdk);
	}



	

	

}
